﻿Imports KOR.Helpers

Namespace BL


    Public Module TapeLengths



#Region "TapeLengths_DML"

        Public Function InsertTapeLength(dict As Dictionary(Of String, Object)) As Integer
            Return DDA.Insert("TapeLengths", dict)
        End Function

        Public Function UpdateTapeLength(dict As Dictionary(Of String, Object), TapeLengthID As Integer) As Integer
            Return DDA.Update("TapeLengths", dict, "TapeLengthID=" & TapeLengthID)
        End Function

        Public Function DeleteTapeLength(ByVal TapeLengthID As Integer) As Integer
            Return DDA.Delete("TapeLengths", "TapeLengthID=" & TapeLengthID, False)
        End Function

#End Region

#Region "TapeLengths_Selection"

        Public Function GetAllTapeLengths() As IDataReader
            Dim sql As String = "SELECT * FROM TapeLengths Order By TapeLengthID DESC"
            Return DDA.SelectData(sql)
        End Function

        Public Function GetTapeLengths(searchFor As String, criteria As String, startRowIndex As Integer, maximumRows As Integer, SortBy As String) As IDataReader
            Dim sql As String
            sql = "SELECT * FROM TapeLengths "

            If SortBy = "" Then SortBy = " CreatedDate Desc"

            Return DDA.SelectDataPaginated(sql, startRowIndex, maximumRows, SortBy)
        End Function

        Public Function TapeLengthsCount(searchFor As String, criteria As String) As Integer
            Dim sql As String
            sql = "SELECT * FROM TapeLengths "
            Return DDA.SelectDataCount(sql)
        End Function

#End Region


    End Module

End Namespace
